package demo2;

import java.awt.*;

interface IShape {
    public String name = "1";
    public static String name2 = "1";
    public static final String name3 = "1";

    public abstract void draw();
//    default public void func() {
//        System.out.println("默认的");
//    }
    public static void staticFunc() {
        System.out.println("staticFunc");
    }


}

class Rect implements IShape {

    @Override
    public void draw() {
        System.out.println("矩形！");
    }

//    @Override
//    public void func() {
//        System.out.println("重写这个方法！");
//    }
}
class Flower implements IShape {
    @Override
    public void draw() {
        System.out.println("❀！");
    }
}
public class Test {
    public static void drawMap(IShape shape) {
        shape.draw();
    }
    public static void main(String[] args) {
        //IShape iShape = new IShape();//接口不能被实例化
        IShape shape = new Rect();//向上转型
        //Rect rect = new Rect();
        IShape shape2 = new Flower();//向上转型

        drawMap(shape);
        //drawMap(rect);
        drawMap(shape2);

        IShape.staticFunc();

    }
}



